import { ProductFieldNameMappingEnum } from '@model/enum/FieldMappingEnum'
import { QualityInfoTypeValueEnum } from '@model/enum/QualityInfoEnum'

interface QualityInfoOriginal {
  // 计算方式 (MANUAL，手动  AUTO 自动)
  qualityCalculation?: string | QualityInfoTypeValueEnum
  // 质保开始时间
  qualityStartTime: string | Date | null
  // 质保结束日期 
  qualityEndTime: string | Date | null
  // 质保状态
  qualityStatus: string
}

interface QualityInfoForm {
  // 质保开始时间
  [ProductFieldNameMappingEnum.QualityInfoStartTime]: string
  // 质保结束日期
  [ProductFieldNameMappingEnum.QualityInfoEndTime]: string
  // 质保状态
  [ProductFieldNameMappingEnum.QualityInfoStatus]: string
}

interface QualityInfoFormGroup {
  // 是否为自动计算
  isAutoComputed?: boolean
  // 是否为手动添加
  isManualAdd?: boolean
  // 自动计算
  auto?: QualityInfoForm
  // 手动添加
  manual?: QualityInfoForm
}

interface QualityInfoRecord {
  action: string
  attachments: any[]
  content: { 
    updateContent: string, 
    updateType: string
  }
  createTime: string
  createUser: string | null
  guideProfessions: string | null
  id: string
  isGuideData: boolean
  mediafiles: any | null
  module: string
  primaryId: string
  primaryName: string
  showInOwn: number
  tenantId: string
  userId: string
  userName: string
}

type QualityInfoFormType = QualityInfoForm | Record<string, any>

export {
  QualityInfoOriginal,
  QualityInfoForm,
  QualityInfoFormGroup,
  QualityInfoFormType,
  QualityInfoRecord
}